import request from '@/utils/request'
import { encrypt } from '@/utils/jsencrypt'

export function login(data) {
  // 加密
  data.password = encrypt(data.password)
  return request({
    url: '/wms/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/wms/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/wms/user/logout',
    method: 'post'
  })
}

export function findAll(params) {
  return request({
    url: '/wms/user/findAll',
    method: 'get',
    params
  })
}

export function delBatch(params) {
  return request({
    url: '/wms/user/delBatch',
    method: 'get',
    params
  })
}

export function addWmsUser(data) {
  return request({
    url: '/wms/user/add',
    method: 'post',
    data
  })
}
